.TH std::atomic::operator= 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::atomic::operator= \- std::atomic::operator=

.SH Synopsis
   T operator=( T desired ) noexcept;                    \fB(1)\fP \fI(since C++11)\fP
   T operator=( T desired ) volatile noexcept;           \fB(2)\fP \fI(since C++11)\fP
   atomic& operator=( const atomic& ) = delete;          \fB(3)\fP \fI(since C++11)\fP
   atomic& operator=( const atomic& ) volatile = delete; \fB(4)\fP \fI(since C++11)\fP

   1,2) Atomically assigns desired to the atomic variable. Equivalent to
   store(desired).

   It is deprecated if std::atomic<T>::is_always_lock_free is false and   \fI(since C++20)\fP
   overload \fB(2)\fP participates in overload resolution.

   3,4) Atomic variables are not CopyAssignable.

.SH Parameters

   desired - value to assign

.SH Return value

   1,2) desired

.SH Notes

   Unlike most assignment operators, the assignment operators for atomic types do not
   return a reference to their left-hand arguments. They return a copy of the stored
   value instead.

.SH See also

   constructor   constructs an atomic object
                 \fI(public member function)\fP
